/* 格式工具栏样式 */
.format-toolbar {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  min-height: 60px;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toolbar-label {
  font-size: 14px;
  font-weight: 500;
  color: #495057;
  white-space: nowrap;
}

.button-group {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.format-button {
  padding: 6px 12px;
  background-color: white;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  font-weight: 500;
  color: #495057;
}

.format-button:hover {
  background-color: #e3f2fd;
  border-color: #1976d2;
  color: #1976d2;
}

.format-button.active {
  background-color: #1976d2;
  border-color: #1976d2;
  color: white;
}

.format-button:active {
  transform: translateY(1px);
}

/* 颜色选择器样式 */
.color-picker {
  display: flex;
  gap: 4px;
  align-items: center;
}

.color-button {
  width: 24px;
  height: 24px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.color-button:hover {
  transform: scale(1.1);
  border-color: #1976d2;
}

.color-button.active {
  border-color: #1976d2;
  box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.2);
}

.color-button.active::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 0 0 2px rgba(0, 0, 0, 0.5);
}

.custom-color-input {
  width: 24px;
  height: 24px;
  border: 2px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
  background: none;
}

.custom-color-input:hover {
  border-color: #1976d2;
}

/* 对齐按钮特殊样式 */
.align-button {
  width: 36px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* 导出按钮特殊样式 */
.export-button {
  background-color: #f1f3f5;
  color: #495057;
}

.export-button:hover {
  background-color: #e3f2fd;
  color: #1976d2;
}

/* 复制按钮特殊样式 */
.copy-button {
  background-color: #e8f5e9;
  color: #2e7d32;
  border-color: #c8e6c9;
}

.copy-button:hover {
  background-color: #c8e6c9;
  border-color: #4caf50;
  color: #2e7d32;
}

/* 分隔线 */
.toolbar-separator {
  width: 1px;
  height: 24px;
  background-color: #dee2e6;
  margin: 0 4px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .format-toolbar {
    padding: 8px;
    gap: 12px;
  }
  
  .toolbar-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .toolbar-label {
    font-size: 12px;
  }
  
  .format-button {
    padding: 4px 8px;
    font-size: 12px;
  }
  
  .color-button,
  .custom-color-input {
    width: 20px;
    height: 20px;
  }
  
  .toolbar-separator {
    display: none;
  }
}

/* 加载状态 */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.format-button.loading {
  position: relative;
  color: transparent;
}

.format-button.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* 工具提示 */
.format-button[title] {
  position: relative;
}

/* 无障碍支持 */
@media (prefers-reduced-motion: reduce) {
  .format-button,
  .color-button {
    transition: none;
  }
  
  .format-button.loading::after {
    animation: none;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .format-toolbar {
    background-color: #000;
    border-color: #fff;
  }
  
  .toolbar-label {
    color: #fff;
  }
  
  .format-button {
    background-color: #333;
    color: #fff;
    border-color: #666;
  }
}